
#ifndef MATERIALWRITER_H
#define MATERIALWRITER_H


class QDomDocument;
class QDomElement;
class cceMaterialEffect;
class cceMaterialManager;
class cceMaterialMaterial;
class cceMaterialProgram;
class cceMaterialShader;
class cceMaterialTexture;
class cceMaterialWriter
{
private:
  cceMaterialManager* _manager;

  void WriteTextures(QDomDocument& doc);
  void WriteTexture(QDomDocument& doc, QDomElement& parent, cceMaterialTexture *texture);

  void WriteShaders(QDomDocument& doc);
  void WriteShader(QDomDocument& doc, QDomElement& parent, cceMaterialShader *shader);

  void WritePrograms(QDomDocument& doc);
  void WriteProgram(QDomDocument& doc, QDomElement& parent, cceMaterialProgram *program);

  void WriteEffects(QDomDocument& doc);
  void WriteEffect(QDomDocument& doc, QDomElement& parent, cceMaterialEffect *effect);

  void WriteMaterials(QDomDocument& doc);
  void WriteMaterial(QDomDocument& doc, QDomElement& parent, cceMaterialMaterial *material);

public:
  cceMaterialWriter(cceMaterialManager* manager);

  void WriteAll ();
  void WriteTextures ();
  void WriteShaders ();
  void WritePrograms ();
  void WriteEffects ();
  void WriteMaterials ();
};

#endif // MATERIALWRITER_H
